package com.example.liu_test.service.impl;

import com.baomidou.mybatisplus.extension.api.R;
import com.example.liu_test.mapper.userVoMapper;
import com.example.liu_test.pojo.RespBean;
import com.example.liu_test.service.UserVoService;
import com.example.liu_test.vo.userVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional //实现事务的时候要在业务类中加入该注解
public class UserVoServiceImpl implements UserVoService {

    @Autowired
    private userVoMapper userVoMapper;

    @Override
    public RespBean queryAll() {
        List<userVo> userVos = userVoMapper.sqlQueryAll();
        return RespBean.success("success",userVos);
    }

    @Override
    public List<userVo> sqlQueryAll() {
        return userVoMapper.sqlQueryAll();
    }


}
